package cloudoer.blog.service.impl;

import cloudoer.blog.base.BaseService;
import cloudoer.blog.entity.Type;
import cloudoer.blog.service.TypeService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("typeService")
public class TypeServiceImpl extends BaseService implements TypeService{

    public List<Type> getAll() {
        return typeMapper.selectAll();
    }

    public Type getById(String id) {
        return typeMapper.selectByPrimaryKey(id);
    }

    public void add(Type type) {
        typeMapper.insertSelective(type);
    }

    public void update(Type type) {
        typeMapper.updateByPrimaryKeySelective(type);
    }

    public void delete(String id) {
        typeMapper.deleteByPrimaryKey(id);
    }
}
